<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>全部动态</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/dynamic.css">
</head>
<body>

<jsp:include page="../public/header.jsp"/>

<div class="main">
    <div class="sidebar">
        <span class="title">热门推荐</span>
        <ul>
            <c:forEach var="hot" items="${requestScope.hot.list}">
                <li>
                    <a href="${pageContext.request.contextPath}/dynamic/${hot.dynamicId}">${hot.dynamicTitle}</a>
                </li>
            </c:forEach>
        </ul>
    </div>
    <div class="left_bar">
        <div class="cell">
            <h3 class="title">全部动态</h3>
            <a class="fr btn" href="${pageContext.request.contextPath}/dynamic/create">我要发表</a>
        </div>
        <c:forEach items="${requestScope.pageInfo.list}" var="dynamicAllVO">
            <div class="cell">
                <img class="fl headImg" src="${dynamicAllVO.customer.customerHeadImg}" alt="头像">
                <div class="content">
                    <p class="topic_title">
                        <a href="${pageContext.request.contextPath}/dynamic/${dynamicAllVO.dynamic.dynamicId}">${dynamicAllVO.dynamic.dynamicTitle}</a>
                    </p>
                    <div class="label">
                        <p class="spanBox fl">
                            <span>${dynamicAllVO.customer.customerName}</span>
                            <span>
                                <fmt:formatDate value="${dynamicAllVO.dynamic.dynamicTime}" pattern="yyyy-MM-dd"/>
                            </span>
                        </p>
                        <p class="spanBox fr">
                            <span class="like">赞 ${dynamicAllVO.like}</span>
                            <span class="collect">收藏 ${dynamicAllVO.collect}</span>
                            <span class="answer">回复 ${dynamicAllVO.comment}</span>
                        </p>
                    </div>
                </div>
            </div>
        </c:forEach>
        <ul class="cell">
            <li>
                <c:if test="${requestScope.pageInfo.isFirstPage}">
                    <span class="dis">&laquo;</span>
                </c:if>
                <c:if test="${!requestScope.pageInfo.isFirstPage}">
                    <a href="${pageContext.request.contextPath}/dynamic?page=${requestScope.pageInfo.prePage}">&laquo;</a>
                </c:if>
            </li>
            <c:forEach var="i" begin="1" end="${requestScope.pageInfo.pages}" step="1">
                <li>
                    <a href="${pageContext.request.contextPath}/dynamic?page=${i}"
                       class="${i==requestScope.pageInfo.pageNum?"choose":""}">${i}</a>
                </li>
            </c:forEach>
            <li>
                <c:if test="${requestScope.pageInfo.isLastPage}">
                    <span class="dis">&raquo;</span>
                </c:if>
                <c:if test="${!requestScope.pageInfo.isLastPage}">
                    <a href="${pageContext.request.contextPath}/dynamic?page=${requestScope.pageInfo.nextPage}">&raquo;</a>
                </c:if>
            </li>
        </ul>
        <%--<div class="cell">--%>
        <%--<img class="fl headImg" src="" alt="头像">--%>
        <%--<div class="content">--%>
        <%--<p class="topic_title">--%>
        <%--<a href="">--%>
        <%--这里是内容这里是内容这里是内容这里是内容这里是内容--%>
        <%--</a>--%>
        <%--</p>--%>
        <%--<div class="label">--%>
        <%--<p class="spanBox fl">--%>
        <%--<span>用户名</span>--%>
        <%--<span>发表时间</span>--%>
        <%--</p>--%>
        <%--<p class="spanBox fr">--%>
        <%--<a class="like" href="">赞 20</a>--%>
        <%--<a class="collect" href="">收藏 5</a>--%>
        <%--<a class="answer" href="">回复 40</a>--%>
        <%--</p>--%>
        <%--</div>--%>
        <%--</div>--%>
        <%--</div>--%>
    </div>
</div>

<jsp:include page="../public/footer.jsp"/>

</body>
</html>
